const express = require('express')
const cors = require('cors')
const {userRouter} = require('./router/user.js')
const {goodsRouter} = require('./router/goods.js')
const {bannerRouter} = require('./router/banner.js')
const {categoryrRouter} = require('./router/category.js')
const app = express()

// 集成cors
// app.use(cors())

//处理json格式的参数
app.use(express.json()) 
//处理key=value参数
app.use(express.urlencoded({extended:false}))

// 引入路由
app.use(userRouter)
app.use(goodsRouter)
app.use(bannerRouter)
app.use(categoryrRouter)

app.listen(3000,console.log('监听3000端口，启动服务成功!'))